package br.com.pheat.factory;

import java.sql.Connection;
import java.sql.SQLException;

public class ConnectionFactory {
	
	private static void registraDriverJdbc() {

		try {
			Class.forName("org.postgresql.Driver");
		} catch (ClassNotFoundException ex) {

			ex.printStackTrace();

			System.exit(1);

		}
	}

	public static Connection getConnection() throws SQLException{
		
		//String server = "192.168.0.102";
		//String database = "pheat";
		//String usuario = "postgres";
		//String senha = "POSTGRES";
		//String url = "jdbc:postgresql://" + server + "/" + database;
		Connection conn = null;
		//registraDriverJdbc();
		//return DriverManager.getConnection(url, usuario, senha);
		try {
			conn =  Conexao.getConnection();
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return conn;
	}
	
}